package com.sky.context;

public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 设置ThreadLocal,线程的局部变量，登录人id
     * @param id
     */
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    /**
     * 获取ThreadLocal,线程的局部变量，登录人id
     * @param
     */
    public static Long getCurrentId() {
        return threadLocal.get();
    }

    /**
     * 移除ThreadLocal,线程的局部变量，登录人id
     * @param
     */
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
